package com.space.netspider;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

import java.util.List;
import java.util.Map;

/**
 * @Author yangyf
 * @Date 2021/6/10 0010 11:08
 * @Version 1.0
 */
public class ConsolePipeline implements Pipeline{
    @Override
    public void process(ResultItems resultItems, Task task) {
        //遍历所有结果，输出到控制台
        List<LawyerBean> list = (List<LawyerBean>)resultItems.getAll().get("list");
        list.forEach(lawyerBean -> {
            System.out.println(lawyerBean.toString());
        });

    }
}
